import MSData
import WorkerMSAPI
import WorkerMSDB
import MSLogger
import MSDBTemplates
import WorkerPCNFirebird

import time
import os
import sys
import heartbeating

MSLogger.logInit('C:\\safe\\ms.test.log', 6, True)
MSLogger.logInfo('ms driver started')
reader = WorkerMSDB.Worker('localhost', '2929', 'PGSMData', 'sa', 'safeinside')
reader.connect()

objects = []
MSDBTemplates.GET_MSObjects_FROM_CarOnline(reader.connection.cursor(), objects)

no = []
for o in objects:
    if o.objectMSId == 50: no.append(o)

#reader.readEventsPGSM(objects)
#reader.readEventsContactId(objects)
reader.readEventsBolid(no)

